<?php

class UserModel extends CI_Model{
    public function validateUser($user, $password){
        $this->db->select("ID_USUARIO");
        $this->db->from("usuario");
        $this->db->where("ID_USUARIO = '$user'");
        $this->db->where("contrasenha = '$password'");
        $query = $this->db->get();
        $users = $query->result();
        if(count($users) == 1){
            return true;
        }else{
            return false;
        }
    }
}

?>
